if __name__ == '__main__':
    dt = {
        "name": "刘光旭",
        "hobby": "Hello World",
        "age": "18"
    }
    a = list()
    for key in dt.keys():
        a.append(key)
    while True:
        cont = input("请输入：")
        if cont in a:
            print(dt.get(cont))
        elif cont == "n" or cont == "N":
            print("已退出")
            break
        else:
            print("键不存在")

    # try:
    #     if cont == "n" or "N":
    #         break
    #     else:
    #         print(dt[cont])
    # except:
    #     print("键不存在")
